﻿using SharedContracts.Types;
using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using System.Threading.Tasks;
using TalentDesk.Contracts.Ef;

namespace TalentDesk.Contracts.ServiceContracts
{
    [ServiceContract(Namespace = TalentDesk.Contracts.DataContracts.Namespaces.ServiceContractNS)]
    public interface IAuthenticationService
    {
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        User AuthenticateUser(string userName, string password);

        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        int SaveUser(User p_oUser);

        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        User GetUsersByUserNamePassword(string p_sUserName, string p_sPassword);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        List<User> GetUsers(bool? p_bIsActive = null);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        User GetUser(int p_iUserId, bool P_bIsIncludeRole = false);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        User AddDeleteUserRole(List<int> p_lDeleteRoleId, List<int> p_lAddRoleId, int p_iUserId, int p_iProcessingUserId);

        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        List<Role> GetRoles();

        #region Controller
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        List<Controller> GetControllers();
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        Controller GetControllerByControllerId(int p_iControllerId);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        Controller SaveController(Controller p_oController);

        #endregion

        #region Action
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        List<TalentDesk.Contracts.Ef.Action> GetActions();
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        List<TalentDesk.Contracts.Ef.Action> GetActionsByControllerId(int p_iControllerId);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        TalentDesk.Contracts.Ef.Action GetActionByActionId(int p_iActionId);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        TalentDesk.Contracts.Ef.Action SaveAction(TalentDesk.Contracts.Ef.Action p_oAction);
    
        #endregion

        #region Menu
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        List<Menu> GetMenus(bool? p_bIsActive = true);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        List<Menu> GetMainMenus(bool? p_bIsActive = true);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        List<Menu> GetSubMenus(int p_iParentMenuId, bool? p_bIsActive = true);
        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        Menu SaveMenu(Menu p_oMenu);

        [OperationContract]
        [FaultContract(typeof(ExceptionInformation))]
        Menu GetMenusByMenuId(int p_iMenuId);
        #endregion

    }
}
